<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-dns-prefetch-control" content="on">
    <title>{% block title %}My Site{% endblock %}</title>
    {% block head %}
    <link rel="dns-prefetch" href="//cdn.bootcss.com">
    <script src="https://cdn.bootcss.com/lazyload/2.0.3/lazyload-min.js"></script>
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
    <script src="https://cdn.bootcss.com/axios/0.17.1/axios.js"></script>
    <script src="https://cdn.bootcss.com/x-tag/1.5.11/x-tag-core.js"></script>
    <script src="https://cdn.bootcss.com/jquery.pjax/2.0.1/jquery.pjax.js"></script>
    <script src="https://cdn.bootcss.com/localforage/1.6.0/localforage.js"></script>
    {% endblock %}
    {% block styles %}{% endblock %}
</head>
<body>
	<a href="/index/star">jump to star</a>
	<a href="/index/praise">jump to thumb</a>
    <div id="changeCon">
    	{% block content %}{% endblock %}
    </div>
   <script type="text/javascript">
   	$(document).pjax('a', '#changeCon');
   	localforage.getItem('advertisement',function(err,value){
   		if (value==null) {
           $.ajax({
                    url:'/index/adv',
                    success:function(data){
                         localforage.setItem('advertisement', data);
                         $("body").prepend(data);
                    }
                });
   		}else{
   			$("body").prepend(value)
   		}
   	})
   </script> 
</body>
{% block script %}{% endblock %}
</html>